import wx


class DiaChoiceStanderd(wx.SingleChoiceDialog):
    Books = ('电源设备分册',
             '有线设备分册',
             '无线设备分册',
             '线路工程分册',
             '管道工程分册',
             )

    def __init__(self, parent):
        super().__init__(parent, '请选择一个国标分册', '选择对话框', self.Books)

if __name__ == "__main__":
    class MyFrame(wx.Frame):
        def __init__(self):
            super().__init__(None, -1, 'haha', size=(200, 100))
            btn = wx.Button(self, -1, 'baba', size=(10, 10))
            self.Bind(wx.EVT_BUTTON, self.OnClick, btn)

        def OnClick(self, event):
            # modal = DiaTable2add(self, 'baba').ShowModal()
            data = [1,2,34,56]
            dia = DiaChoiceStanderd(self)
            modal = dia.ShowModal()
            print(dia.GetStringSelection())
            dia.Destroy()

    app = wx.App()
    MyFrame().Show()
    app.MainLoop()
